package net.ys.dao.mapper;

import net.ys.bean.AprApollo;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * @author nmy
 */
public class AprApolloMapper implements RowMapper<AprApollo> {
    @Override
    public AprApollo mapRow(ResultSet resultSet, int i) throws SQLException {
        AprApollo apollo = new AprApollo();
        apollo.setId(resultSet.getInt("id"));
        apollo.setProjectName(resultSet.getString("project_name"));
        apollo.setAppName(resultSet.getString("app_name"));
        apollo.setNamespace(resultSet.getString("namespace"));
        apollo.setConfigKey(resultSet.getString("config_key"));
        apollo.setConfigValue(resultSet.getString("config_value"));
        apollo.setTapdType(resultSet.getInt("tapd_type"));
        apollo.setTapdId(resultSet.getString("tapd_id"));
        apollo.setCreateTime(resultSet.getLong("create_time"));
        apollo.setUpdateTime(resultSet.getLong("update_time"));
        apollo.setEnvTestCommit(resultSet.getInt("env_test_commit"));
        apollo.setEnvPreCommit(resultSet.getInt("env_pre_commit"));
        apollo.setEnvProdCommit(resultSet.getInt("env_prod_commit"));
        return apollo;
    }
}